<?php
namespace App\Api\Controllers;

use App\Api\Traits\Responder;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use Responder;

    public function createData($model, $input)
    {
        if (is_object($model)) {
            foreach($input as $key=>$val){
                if(!empty($input[$key])){
                    $model->$key = $input[$key];
                }
            }
            $model->save();
            return $model;
        }
        return false;
    }
}